@extends('app')

@section('content')
<ul class="nav nav-tabs">
    <li class="active"><a href="{{ url('/admin/content/banner') }}">列表</a></li>
    <li><a href="{{ url('/admin/content/banner/create') }}">添加</a></li>
</ul>


<div class="panel panel-default mt20">

    <div class="table-responsive panel-body">
        <table class="table table-hover">
          <thead>
            <tr>
              <th>图片</th>
              <th>标题</th>
              <th>所属模块</th>
              <th>是否显示</th>
              <th>发布时间</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
          @foreach($result as $res)
            <tr id="banners_{{ $res->id }}">
              <td><img src="{{ $res->attachment->url }}" width="120" height="60"></td>
              <td><a href="{{ url('/admin/content/banner/'.$res->id.'/edit') }}">{{ $res->title }} </a></td>
              <td>
              @if($res->app == 'index') 首页
              @elseif($res->app == 'employ') 就业指南
              @elseif($res->app == 'company')企业招聘
              @elseif($res->app == 'bbs')青苜社区
              @elseif($res->app == 'teaches')充电加油
              @endif
              </td>
              <td>{{ ($res->display==1)  ? '否':'是' }}</td>
              <td>{{ $res->created_at}}</td>
              <td>
                <a href="{{ url('/admin/content/banner/'.$res->id.'/edit') }}"><i class="glyphicon glyphicon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <a href="javascript:void(0);" onclick="delete_one('/admin/content/banner/{{$res->id}}','{{$res->id}}','{{ csrf_token() }}')"><i class="glyphicon glyphicon-remove-sign"></i></a>
              </td>
            </tr>
          @endforeach
          </tbody>
        </table>
    </div>
</div>
<div>{!! $result->render() !!} </div>
@endsection
